﻿using XYAC.Framework.MonitorTireMaterialOnline.Context;
using XYAC.Framework.MonitorTireMaterialOnline.LocalData.Context;

namespace XYAC.Framework.MonitorTireMaterialOnline.IServices
{
    public interface ILocalDataService : IServiceBase<int, LocalDataContext>
    {
        /// <summary>
        /// 创建数据库
        /// </summary>
        /// <returns></returns>
        bool CreateDb();

        /// <summary>
        /// 定期删除LocalRecord记录数据
        /// </summary>
        /// <param name="days"></param>
        /// <returns></returns>
        int RemoveTimeovered(int days);

        #region Today当日数据上传
        /// <summary>
        /// 同步APP中Access数据库到本地用于数据同步,SpecVal表
        /// </summary>
        /// <returns></returns>
        int SyncAppDataToLocal_SpecVal<TContext>(int RowData = 20) where TContext : ReportContext;
        /// <summary>
        /// 同步APP中Access数据库到本地用于数据同步,WeightData表
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncAppDataToLocal_WeightData<TContext>(int RowData = 20) where TContext : ReportContext;
        /// <summary>
        /// 上传胎侧检测数据到远程数据库
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncSemiSteelSideInspectionReportToRemote<TContext>(int RowData = 20) where TContext : ReportContext;
        /// <summary>
        /// 上传胎面检测数据到远程数据库
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncSemiSteelTreadScanReportToRemote<TContext>(int RowData = 20) where TContext : ReportContext;

        /// <summary>
        /// 上传三角胶数据到远程数据库
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncSemiSteelTriangleRubberReportToRemote<TContext>(int RowData = 20) where TContext : ReportContext;
        #endregion



        #region Yesterday 昨日数据上传
        /// <summary>
        /// 上传三角胶数据到远程数据库(昨日)
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncSemiSteelTriangleRubberReport_YST_ToRemote(int RowData = 20);


        /// <summary>
        /// 上传胎侧检测数据到远程数据库(昨日)
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncSemiSteelSideInspectionReport_YST_ToRemote(int RowData = 20);
        /// <summary>
        /// 上传胎面检测数据到远程数据库(昨日)
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncSemiSteelTreadScanReport_YST_ToRemote(int RowData = 20);
        /// <summary>
        /// 同步昨日的数据
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncAppDataToLocal_YST_SpecVal(int RowData = 20);
        /// <summary>
        /// 同步昨日的数据,WeightData
        /// </summary>
        /// <typeparam name="TContext"></typeparam>
        /// <param name="RowData"></param>
        /// <returns></returns>
        int SyncAppDataToLocal_YST_WeightData(int RowData = 20);
        /// <summary>
        /// 同步数据到远程数据库,WeightData
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        int SyncWeightDataToRemote<T>();
        /// <summary>
        /// 同步昨日的数据到远程数据库,WeightData
        /// </summary>
        /// <returns></returns>
        int SyncWeightData_YST_ToRemote();
        #endregion

    }
}
